<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\DB;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateRentClothAfterTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('rent_cloth_after', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->integer('user_id')->default(0)->comment('=user.id');
            $table->integer('rent_id')->default(0)->comment('=rentCloth.id');
            $table->integer('shop_id')->default(0)->comment('=shop.id');
            $table->string('commodity_attr_id')->default('')->comment('=commodityAttr.id');
            $table->decimal('price','10','2')->default('0')->comment('退款金额');
            $table->string('comment')->default('')->comment('备注');
            $table->tinyInteger('status')->default(0)->comment('1退货中2审核中3已退款');
            $table->timestamps();
        });
        DB::statement("ALTER TABLE `rent_cloth_after` comment '售后订单表';");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('rent_cloth_after');
    }
}
